home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 71 / MOBICLIC 71.ISO / mac / DATA / COMMUN / temp0001 / 00006_Script_gestion du son < prev    next >
Text File  |  2004-12-05  |  4KB  |  136 lines

  1. -- gestion du son
  2. global dernierSon,gL_Zap,volumeOn,menusActifs,ouvreVolume,  chemin, gFlag_soustitrage
  3. -- dernierSon : nom du dernier son jouΘ
  4. -- gL_Zap[16] : liste α 8 termes contenant le niveau sonore de chaque piste son
  5. -----------------------------------------------
  6. on joueSon nom, n
  7.   global gL_Zap
  8.   tampon = nom
  9.   -- lecture d'un son
  10.   global glocal_Folder
  11.   --  if  voidP(glocal_Folder) then exit
  12.   if the paramCount = 1 then
  13.     n = 3
  14.   end if
  15.   gL_Zap[30] = n -- on enregistre le n░ de piste son lancΘ (pour la fenΩtre commentaire)
  16.   
  17.   if offset(":", nom) = 0 then
  18.     case(the movieName.char[1..5] = "RECRE") of 
  19.       1:
  20.         nom ="SONS_ARRIBA:"& nom
  21.       0:
  22.         nom ="SONS_"& glocal_Folder&":"& nom
  23.     end case
  24.   end if
  25.   
  26.   dernierSon = nom
  27.   --
  28.   put the pathName & nomDos(nom) & ".aif" into temp
  29.   put "  Son jouΘ : " & dernierSon
  30.   sound playFile n, temp
  31.   -- rΘglage du niveau des autres canaux
  32.   repeat with i=1 to 8
  33.     if i<>n and gL_Zap[16][i]>110 then
  34.       sound(i).volume = 50
  35.     end if
  36.   end repeat
  37.   ---------------------------------------lancement du sous-titrage pour les sourds------------ 
  38.   if the activeWindow = the Stage then gere_soustitrage(tampon)
  39.   --------------------------------------------------------------------------------------------
  40. end joueSon
  41. ---------------------------------------------
  42. on lowjoueSon nom, n
  43.   global glocal_Folder
  44.   if  voidP(glocal_Folder) then exit
  45.   if the paramCount = 1 then
  46.     n = 3
  47.   end if
  48.   if voidP(gL_Zap[16])=1 then Init_gL_Zap[16]
  49.   if not(nom contains "SONS") then
  50.     if offset(":", nom) = 0 then
  51.       case(the movieName.char[1..3] = "LAN") of 
  52.         1:
  53.           nom ="SONS:"& nom
  54.         0:
  55.           nom ="SONS_"& glocal_Folder&":"& nom
  56.       end case
  57.     end if
  58.   end if
  59.   dernierSon = nom
  60.   --
  61.   put the pathName & nomDos(nom) & ".aif" into temp
  62.   put "  Son jouΘ : " & dernierSon
  63.   sound(n).volume = zvolume(n)
  64.   sound playFile n, temp
  65.   
  66.   ---------------------------------------lancement du sous-titrage pour les sourds------------ 
  67.   if gFlag_soustitrage = 1 then gere_soustitrage(nom)
  68. end
  69. --------------------------------------------------------------------------------------------
  70. on Init_niveauxsons
  71.   global gL_Zap
  72.   --  gL_Zap[16]=[]
  73.   --  repeat with i = 1 to 8
  74.   --    gL_Zap[16].add(255)
  75.   --  end repeat
  76.   gL_Zap[16] = [150,200,255,255,255,255,255,75,6]
  77. end
  78. -----------------
  79. on niveauSon
  80.   global gL_Zap
  81.   -- rΘglage du volume des pistes son
  82.   if voidP(gL_Zap) then
  83.     Init_niveauxsons()
  84.   end if
  85.   repeat with i=1 to 8
  86.     sound(i).volume = gL_Zap[16][i]
  87.   end repeat
  88. end
  89.  
  90. ----------------------------------------
  91. on attendreSon p
  92.   -- attendre la fin d'un son
  93.   set T = 1.0/the frameTempo
  94.   repeat while soundBusy(p)
  95.     updateStage
  96.     temporise(T)
  97.   end repeat
  98. end
  99. -----------------------------------------
  100. on coupeSon
  101.   -- dΘsactivation des pistes audio
  102.   repeat with i=1 to the paramCount
  103.     if value(param(i))<>0 then
  104.       puppetSound (param(i)),0
  105.     else
  106.       listeSons param(i)
  107.     end if
  108.   end repeat
  109. end coupeSon
  110. -------------------------------------------
  111. on listeSons chaine
  112.   n=offset(">", chaine)
  113.   n1=value(char 1 to n-1 of chaine)
  114.   n2=value(char n+1 to length(chaine) of chaine)
  115.   repeat with j=n1 to n2
  116.     puppetSound j,0
  117.   end repeat
  118. end listeSons
  119. -----------------------------------
  120. on calcul_nivson No
  121.   global gL_Zap
  122.   NewNiv = [0,50,100,150,200,255][No]
  123.   OldNiv = [0,50,100,150,200,255][gL_Zap[16][9]]
  124.   L_NewVolumes = []
  125.   repeat with i = 1 to 8
  126.     case(gL_Zap[16][i]) of
  127.       0:
  128.         gL_Zap[16][i] = NewNiv
  129.       otherwise:
  130.         gL_Zap[16][i] = integer((float(gL_Zap[16][i])*NewNiv)/OldNiv)
  131.     end case
  132.   end repeat
  133.   gL_Zap[16][9] = No
  134.   niveauson()
  135. end
  136. --------------------